/*
 * @Author: lihaogn
 * @Date: 2021-06-12 23:44:45
 * @LastEditTime: 2022-05-15 18:25:07
 * @LastEditors: Please set LastEditors
 * @Description: 路由配置
 * @FilePath: \lix-vue2-demos\src\router\index.js
 */
import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '@/views/layout/index.vue'
import Welcome from '@/views/Welcome.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home/welcome'
  },

  {
    path: '/home',
    name: 'home',
    component: Home,
    children: [
      {
        name: 'welcome',
        path: 'welcome',
        component: Welcome
      },
      // style
      {
        name: 'cal-height',
        path: 'demo/style/calHeight',
        component: () => import('@/views/demo/style/CalHeight.vue')
      },
      {
        name: 'adaption',
        path: 'demo/style/adaption',
        component: () => import('@/views/demo/style/SelfAdaptionLayout.vue')
      },
      {
        name: 'table-width',
        path: 'demo/style/tableWidth',
        component: () => import('@/views/demo/style/TableWidth.vue')
      },
      // 动画 animation
      {
        name: 'animation',
        path: 'demo/animation/',
        component: () => import('@/views/demo/animation/index.vue')
      },
      // 应用 apply
      {
        name: 'count-down',
        path: 'demo/apply/countDown',
        component: () => import('@/views/demo/apply/CountDown.vue')
      },
      {
        name: 'drag',
        path: 'demo/apply/drag',
        component: () => import('@/views/demo/apply/DragAction.vue')
      },
      {
        name: 'virtual-scroll',
        path: 'demo/apply/virtualScroll',
        component: () => import('@/views/demo/apply/VirtualScroll.vue')
      },
      {
        name: 'slideshow',
        path: 'demo/apply/slideshow',
        component: () => import('@/views/demo/apply/Slideshow.vue')
      },
      {
        name: 'fileVisit',
        path: 'demo/apply/fileVisit',
        component: () => import('@/views/demo/apply/file-visit/index.vue')
      },
      // vue
      {
        name: 'vue-style',
        path: 'demo/vue/style',
        component: () => import('../views/demo/vue/style/index.vue')
      },
      {
        name: 'vue-prop',
        path: 'demo/vue/prop',
        component: () => import('../views/demo/vue/prop/index.vue')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
